source_path = '/home/wzhu/Documents/CarAoT/testPrepData';
out_file_name = '/home/wzhu/Documents/CarAoT/testCode/detection/img_file_list.txt';

file_list = dir([source_path '/*_0_org.png']);
n_file = length(file_list);

p_file= fopen(out_file_name,'w');
fprintf(p_file,'%d\n',n_file);
for i_file = 1:n_file
    end_ind = strfind(file_list(i_file).name,'_0_org.png');
    out_string = [source_path '/' file_list(i_file).name(1:end_ind-1)];
    fprintf(p_file,'%s\n',out_string);
end
fclose(p_file);